package com.part2.dao.common;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import com.part2.common.query.Page;

public interface BaseDao<T, ID> {

	public void save(T entity);

	public T findById(Class<T> entityClass, ID id);

	public List<T> findAll(Class<T> entityClass);

	public void saveOrUpdate(T entity);

	public void delete(T entity);

	public Page<T> findByPage(final Page<T> page, final String hql,
			final Object... values);

	public Object findUnique(final String hql, final Object... values);

	public List<Object> find(String hql, Object... values);

	public int findTotalCount(Class<T> entityClass, final String where,
			final Object... values);

	public int findTotalCount(Class<T> entityClass);

	public int findInt(final String hql, final Object... values);

	public List<T> findByProperty(Class<T> entityClass, String propertyName,
			Object value);

	public List<T> findByExample(T entity);

	public T merge(T entity);

	public void attachClean(T entity);

	public Query createQuery(Session session, String hql, Object... objects);

}